<?php
namespace app\backstage\model;

use think\Db;
use think\Model;

class Link extends Model
{
    protected $table = 'quick_link';

    /*获取单条记录*/
    public function getOne($where, $field = '*')
    {
        $info = Db::table($this->table)->where($where)->field($field)->findOrEmpty();
        return $info;
    }

    /*获取列表记录*/
    public function getList($where, $field = '*', $page = 1, $pageSize = 100, $orderBy = [], $groupBy = '')
    {
        $list = Db::table($this->table)->where($where)->field($field)
            ->page($page, $pageSize)->order($orderBy)->group($groupBy)->select();

        return $list ? $list : [];
    }

    /*获取列表记录*/
    public function getAll($where,$field='*',$orderBy=[])
    {
        $list = Db::table($this->table)->where($where)->field($field)->order($orderBy)->select();

        return $list ? $list : [];
    }

}